package com.lyl.syt.controller;

import com.lyl.syt.client.OrderFeignClient;
import com.lyl.syt.common.result.Result;
import com.lyl.syt.vo.order.OrderCountQueryVo;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author Mr.Luo
 * @date 2022-05-27 15:18
 * @desc 统计管理
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/admin/statistics")
public class StatisticsController {
    private final OrderFeignClient orderFeignClient;

    @ApiOperation(value = "获取订单统计数据")
    @GetMapping("getCountMap")
    public Result<Map<String, Object>> getCountMap(@ApiParam(name = "orderCountQueryVo", value = "查询对象", required = false) OrderCountQueryVo orderCountQueryVo) {
        return Result.ok(orderFeignClient.getCountMap(orderCountQueryVo));
    }
}
